# Maintainer: Alexey Pavlov <alexpux@gmail.com>

_realname=backports
pkgbase=mingw-w64-python2-${_realname}
pkgname=("${MINGW_PACKAGE_PREFIX}-python2-${_realname}")
pkgver=1.0
pkgrel=1
pkgdesc="Namespace package required for backports collection (mingw-w64)"
arch=('any')
url="https://pypi.python.org/pypi/backports"
license=('PSF')
depends=("${MINGW_PACKAGE_PREFIX}-python2")

build() {
  cd "${srcdir}"
  cat << EOF > __init__.py
from pkgutil import extend_path
__path__ = extend_path(__path__, __name__)
EOF
  ${MINGW_PREFIX}/bin/python2 -m compileall .
}

package() {
  cd "$srcdir"
  install -Dm644 __init__.py  "${pkgdir}${MINGW_PREFIX}/lib/python2.7/site-packages/backports/__init__.py"
  install -Dm644 __init__.pyc "${pkgdir}${MINGW_PREFIX}/lib/python2.7/site-packages/backports/__init__.pyc"
}
